//这玩意矿物词典是真难同步啊,:<
onEvent('recipes', event => {
  let ingots = ['copper', 'bronze', 'tin', 'aluminum', 'silver', 'lead',
    'nickel', 'zinc', 'brass', 'invar', 'steel', 'constantan', 'gold',
    'uranium', 'osmium', 'cobalt', 'iridium', 'electrum', 'signalum', 'lumium', 'enderium', 'iron', 'osmium'];

  let mod = 'emendatusenigmatica';
  for (let i of ingots) {
    if (i != 'iron' && i != 'gold') {
      event.replaceOutput({}, `#forge:ingots/${i}`, `${mod}:${i}_ingot`);
      event.replaceOutput({}, `#forge:nuggets/${i}`, `${mod}:${i}_nugget`);
      event.replaceOutput({}, `#forge:storage_blocks/${i}`, `${mod}:${i}_block`);
    }
    event.replaceOutput({}, `#forge:plates/${i}`, `${mod}:${i}_plate`); //板
    event.replaceOutput({}, `#forge:rods/${i}`, `${mod}:${i}_rod`); //棍
    event.replaceOutput({}, `#forge:gears/${i}`, `${mod}:${i}_gear`); //齿轮
  }
  event.replaceOutput({}, '#forge:silicon', 'refinedstorage:silicon');

  for (let i of ingots) {
    if (i != 'iridium' && i != 'iron' && i != 'gold') {
      event.custom({
        "type": "tconstruct:casting_basin",
        "cast": {
          "item": 'minecraft:glass'
        },
        "cast_consumed": true,
        "fluid": { "name": `tconstruct:molten_${i}`, "amount": 1296 },
        "result": `${mod}:${i}_block`,
        "cooling_time": 154
      });
      event.custom({
        "type": "tconstruct:casting_table", // 类型:铸造台
        "cast": {
          "item": 'tconstruct:ingot_cast',// 槽中物品
        },
        "cast_consumed": false, // 是否消耗物品
        "fluid": {
          "name": `tconstruct:molten_${i}`, // 液体注册名
          "amount": 144 // 耗量，单位:mB
        },
        "result": `${mod}:${i}_ingot`, // 输出物品
        "cooling_time": 10 // 浇铸时间
      });
      event.custom({
        "type": "tconstruct:casting_table", // 类型:铸造台
        "cast": {
          "tag": 'tconstruct:casts/single_use/ingot',// 槽中物品
        },
        "cast_consumed": false, // 是否消耗物品
        "fluid": {
          "name": `tconstruct:molten_${i}`, // 液体注册名
          "amount": 144 // 耗量，单位:mB
        },
        "result": `${mod}:${i}_ingot`, // 输出物品
        "cooling_time": 10 // 浇铸时间
      });
    }
    else if(i != 'iridium'){
      event.custom({
        "type": "tconstruct:casting_basin",
        "cast": {
          "item": 'minecraft:glass'
        },
        "cast_consumed": true,
        "fluid": { "name": `tconstruct:molten_${i}`, "amount": 1296 },
        "result": `minecraft:${i}_block`,
        "cooling_time": 154
      });
      event.custom({
        "type": "tconstruct:casting_table", // 类型:铸造台
        "cast": {
          "item": 'tconstruct:ingot_cast',// 槽中物品
        },
        "cast_consumed": false, // 是否消耗物品
        "fluid": {
          "name": `tconstruct:molten_${i}`, // 液体注册名
          "amount": 144 // 耗量，单位:mB
        },
        "result": `minecraft:${i}_ingot`, // 输出物品
        "cooling_time": 10 // 浇铸时间
      });
      event.custom({
        "type": "tconstruct:casting_table", // 类型:铸造台
        "cast": {
          "tag": 'tconstruct:casts/single_use/ingot',// 槽中物品
        },
        "cast_consumed": false, // 是否消耗物品
        "fluid": {
          "name": `tconstruct:molten_${i}`, // 液体注册名
          "amount": 144 // 耗量，单位:mB
        },
        "result": `minecraft:${i}_ingot`, // 输出物品
        "cooling_time": 10 // 浇铸时间
      });
    }

  }
})

